package yesjava;

import java.io.*;
// 3
public class MainRead {
    public static void main(String[] args) throws Exception {
        File file = new File("D://dogFile");
        InputStream in =  new BufferedInputStream(new FileInputStream(file));
        ObjectInputStream ois = new ObjectInputStream(in);
        while (in.available()>0){ // 用对象流最接近流来判断
            Dog dog = (Dog) ois.readObject();
            System.out.println(dog);
        }
    }
}




